﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using ITSSP.Web.Models;

namespace ITSSP.Views.UserList
{
    public partial class NewUserWindow : ChildWindow
    {
        public User NewUser { get; private set; }

        public NewUserWindow()
        {
            InitializeComponent();

            this.NewUser = new User();
            this.dataForm1.CurrentItem = this.NewUser;
            this.dataForm1.BeginEdit();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.dataForm1.CommitEdit())
            {
                this.DialogResult = true;
            }
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.dataForm1.CancelEdit();
            this.DialogResult = false;
        }
    }
}

